Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better RangeAggregator when used as a sub-aggregator #4550

Closed
jpountz opened this issue Dec 26, 2013 · 0 comments
Closed

Better RangeAggregator when used as a sub-aggregator #4550

jpountz opened this issue Dec 26, 2013 · 0 comments

Comments

@jpountz
Copy link
Contributor

jpountz commented Dec 26, 2013

RangeAggregator is different from other PER_BUCKET aggregators (such as terms or histogram aggregators) in that it knows the number of buckets it will create in advance. So it could actually be a MULTI_BUCKETS aggregator by just multiplying the bucket ordinals by the number of ranges.

This will make RangeAggregator faster and more memory-efficient when used as a sub-aggregator of other PER_BUCKET aggregators.

@ghost ghost assigned jpountz Dec 26, 2013
jpountz added a commit to jpountz/elasticsearch that referenced this issue Dec 26, 2013
Until now, RangeAggregator was a PER_BUCKET aggregator, expecting to be always
collected with owningBUcketOrdinal == 0. However, since the number of buckets
it creates is known in advance, it can be changed to a MULTI_BUCKETS aggregator
by just multiplying the bucket ordinal by the number of ranges.

This makes aggregations that have ranges as sub aggregations of PER_BUCKET
aggregators more efficient.

Close elastic#4550
brusic pushed a commit to brusic/elasticsearch that referenced this issue Jan 19, 2014
Until now, RangeAggregator was a PER_BUCKET aggregator, expecting to be always
collected with owningBUcketOrdinal == 0. However, since the number of buckets
it creates is known in advance, it can be changed to a MULTI_BUCKETS aggregator
by just multiplying the bucket ordinal by the number of ranges.

This makes aggregations that have ranges as sub aggregations of PER_BUCKET
aggregators more efficient.

Close elastic#4550
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant